<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Customize MultiPowUpload</title>
	<link rel="stylesheet" href="styles.css">
    </head>
<body >
Sample: <b>localization.html</b>&nbsp;&nbsp;<a href="javascript:location.reload(true);"><img border="0" src="images/refresh.png" width="16" height="16">&nbsp;Refresh frame</a>&nbsp;&nbsp;<a target="_parent" href="index.htm"><img border="0" src="images/home.png" width="16" height="16">&nbsp;Examples home</a><br/><br/>
<!-- text below wil be shown if JavaScript disabled at browser -->
<span id="noscriptdiv" style="border:1px  solid #FF0000;display:block;padding:5px;text-align:left; background: #FDF2F2;color:#000;">Active Scripting (JavaScript) should be enabled in your browser for this application to function properly!</span>
<script type="text/javascript">
	document.getElementById('noscriptdiv').style.visibility = 'hidden';
	document.getElementById('noscriptdiv').style.height = 0;
	document.getElementById('noscriptdiv').style.padding = 0;
	document.getElementById('noscriptdiv').style.border = 0;
</script>

This is tool for easy translation messages and labels of MultiPowUpload to any language.
<br/><br/>
How to use translation tool:
<ul style="list-style:decimal;">
<li>At the table at the bottom of the page find default english parameters values.</li>
<li>Replace values for all or only for some of parameters with values translated to your language.</li>
<li>Click <strong>"save xml file"</strong> button and choose path for new file to save translated values. We recommend to place such file at <strong>Flashexamples/Extra/Languages/</strong> folder.</li>
<li>To use ready localization file set <strong>"language.source"</strong> parameter for MultiPowUpload at your webpage.
<br/><strong>Example: <code>"language.source" : "Extra/Languages/Language_ru.xml"</code></strong><br/>See <a href="localizationparamsonpage.html">localizationparamsonpage.html</a> example.</li>
<li><strong>Optional:</strong> You can also modify ready translation file. Click <strong>"load xml file"</strong> button and choose ready localization file stored at <strong>Flashexamples/Extra/Languages/</strong> folder. Than make steps 1-4 to modify values.</li>
</ul>
<script type="text/javascript">

var paramNames = new Array();
var paramValues = new Array();

function MultiPowUpload_onXmlParamsLoad()
{	
	initdefvalues();	
}

function MultiPowUpload_onMovieLoad()
{	
	initdefvalues();	
}


function initdefvalues()
{		
	getValues();
	generateParamsTable();
}

function getValues()
{
	paramNames = new Array();
	paramValues = new Array();
	paramNames = MultiPowUpload.getTranslationParams();
	var i=0;	
	var val;
	for(i=0; i<paramNames.length; i++)			
	{
		val = MultiPowUpload.getParameter(paramNames[i]);
		if(val != null)
			paramValues.push(replaceAll(val, '\n', '%0A'));
		else
			paramValues.push('');
	}
	
}

function generateParamsTable()
{
	var i = 0;		
	
	var tableDiv = document.getElementById('table_container');
	var inner ="<table border='0' cellpadding='0' cellspacing='0' align='left'>";
	var value = "";	
	for(i=0;i<paramNames.length;i++)
	{		
		value = paramValues[i]+"";
		
	
		inner = inner+"<tr><td><font color='#195387'>"+paramNames[i]+"</font> <code>"+mainEscape(value)+"</code></td>"; //("+params[i][1]+")		
		inner = inner+"<td nowrap>&nbsp; <input size='100' id='"+paramNames[i]+"' name='"+paramNames[i]+"' type='text' value=\""+value+"\" > ";
		
		//inner = inner+ "&nbsp;<a href='javascript: applyNow("+i+");' title='Apply it now!'><font color='#0000FF' size='4'><strong>&gt;</strong></font></a>";
		inner = inner+ "&nbsp;<a href='javascript: getDef("+i+");' title='Return default value'>def</a>";	
		inner = inner+"</td></tr>";	
		
	}
	
	inner = inner+"</table>";	
	
	tableDiv.innerHTML = "&nbsp;"+inner;	
}

function applyNow(paramIndex)
{	
	Java.setParam(paramNames[paramIndex], document.getElementById(paramNames[paramIndex]).value);	
}

function getDef(paramIndex)
{	
	document.getElementById(paramNames[paramIndex]).value = paramValues[paramIndex];	
}

function clearTextArea()
{
	document.getElementById('txtCode').value="";
}

function setAll()
{
	for(i=0;i<paramNames.length;i++)	
		if(document.getElementById(paramNames[i]).value!= paramValues[i])	
			applyNow(i);
}



function mainEscape(str)
{
	var result = str;
	result = replaceAll(result, '"', '&quot;');		
	result = replaceAll(result, '<', '&lt;');
	result = replaceAll(result, '>', '&gt;');	
	return result;
}

function mainDEscape(str)
{
	var result = str;
	result = replaceAll(result, '&quot;', '"');	
	result = replaceAll(result, '&lt;', '<');
	result = replaceAll(result, '&gt;', '>');	
	return result;
}

function replaceAll(string, search, replace)
{	
	  return string.split(search).join(replace);
}


</script><br>
<br>
<div id="MultiPowUpload_holder">
<strong>You need at least 10 version of Flash player!</strong>
<a href="http://www.adobe.com/go/getflashplayer">&nbsp;<img border="0" src="images/get_flash_player.gif" alt="Get Adobe Flash player" /></a>
</div>	
<!-- SWFObject home page: http://code.google.com/p/swfobject/
You can replace src value with the http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js (Most users has such file cached)
 -->
<script type="text/javascript" src="Extra/swfobject.js"></script>
<script type="text/javascript">
	var params = {  
		BGColor: "#FFFFFF"
	};
	
	var attributes = {  
		id: "MultiPowUpload",  
		name: "MultiPowUpload"
	};
	
	var flashvars = {
	  "movieUrl": "ElementITMultiPowUpload.swf",
	   "serialNumber": "put your serial number here",
	   "useExternalInterface":"true"
	};

	swfobject.embedSWF("Extra/mpuConfigurator.swf", "MultiPowUpload_holder", "400", "230", "10.0.0", "Extra/expressInstall.swf", flashvars, params, attributes);
</script>


<p>
You can see <font color="#195387">blue colored</font> parameter name, <font color="#009900">green colored</font> default value for loaded translation. Click <strong>"def"</strong> link to restore default value near each parameter.<br/>
</p>
<div id="table_container" >
</div>
</body>
</html>